function KeyboardInput(){}
KeyboardInput.prototype = new Entity();

KeyboardInput.prototype.pressedKey;

KeyboardInput.prototype.init = function()
{
  document.onkeydown = this.keyDown;
  document.onkeyup = this.keyUp;

  this.pressedKey = new Array();
  this.pressedKey["left"] = false;
  this.pressedKey["right"] = false;
}


KeyboardInput.prototype.update = function()
{
}


KeyboardInput.prototype.keyDown = function(evnt)
{
  if (!evnt) {
    var evnt = document.event;
  }

  switch (evnt.keyCode)
  {
    case 16 : RTE.InputManager.KeyboardInput.pressedKey["shift"] = true; break;

    case 65 : RTE.InputManager.KeyboardInput.pressedKey["left"] = true; break;
    case 68 : RTE.InputManager.KeyboardInput.pressedKey["right"] = true; break;
    case 83 : RTE.InputManager.KeyboardInput.pressedKey["up"] = true; break;
    case 87 : RTE.InputManager.KeyboardInput.pressedKey["down"] = true; break;
  }
}


KeyboardInput.prototype.keyUp = function(evnt)
{
  if (!evnt) {
    var evnt = document.event;
  }
  
  switch (evnt.keyCode)
  {
    case 16 : RTE.InputManager.KeyboardInput.pressedKey["shift"] = false; break;

    case 65 : RTE.InputManager.KeyboardInput.pressedKey["left"] = false; break;
    case 68 : RTE.InputManager.KeyboardInput.pressedKey["right"] = false; break;
    case 83 : RTE.InputManager.KeyboardInput.pressedKey["up"] = false; break;
    case 87 : RTE.InputManager.KeyboardInput.pressedKey["down"] = false; break;

    default : console.log("key not mapped");
  }
   console.log(evnt.keyCode);
}